package service.impl;

import exception.UserNotExistException;
import org.springframework.stereotype.Service;
import service.UserService;

/**
 * Author:shixiaojun@itany.com
 * Date:2022/3/9 9:34
 * Version:1.0-SNAPSHOT
 */
@Service
public class UserServiceImpl implements UserService {
    @Override
    public String login(String username, String password) throws UserNotExistException {
        System.out.println("UserServiceImpl.login");
        if("admin".equals(username) && "123456".equals(password)){
            return "登录成功";
        }
        throw new UserNotExistException("用户名或密码错误");
    }

    @Override
    public void register() {
        System.out.println("UserServiceImpl.register");
    }
}
